local wudi=fk.CreateSkill{
    name = "steam__wudi",
}

Fk:loadTranslationTable{
    ["steam__wudi"]="以武登神",
    [":steam__wudi"]="你可将一张牌当作另一即时牌使用，然后直至使用转化牌前，此技能失效。",
    ["#steam__wudi"]="无敌",
    ["#wudi_choose"]="无敌：请选择一张牌当作另一即时牌使用",
}


  
  
wudi:addEffect("viewas", {
    prompt="#wudi_choose",
    pattern = ".",
    interaction = function(self,player)
      local names = {}
      for _, id in ipairs(Fk:getAllCardIds()) do
        local card = Fk:getCardById(id)
        if (card.type == Card.TypeBasic or card:isCommonTrick()) and not card.is_derived then
          local to_use = Fk:cloneCard(card.name)
          if ((Fk.currentResponsePattern == nil and card.skill:canUse(player, to_use) and not player:prohibitUse(to_use)) or
          (Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(to_use))) then
            table.insertIfNeed(names, card.name)
          end
        end
      end
      if #names == 0 then return false end
      return UI.ComboBox { choices = names }
    end,
    card_filter = function(self, player, to_select, selected)
      return #selected == 0
    end,
    view_as = function(self, player,cards)
      if #cards ~= 1 or not self.interaction.data then return end
      local card = Fk:cloneCard(self.interaction.data)
      card:addSubcards(cards)
      card.skillName = wudi.name
      return card
    end,
    before_use = function(self, player, use)
        local room=player.room
        local name=use.card.name
      room:setPlayerMark(player,wudi.name,name)
    end,
    enabled_at_play = function(self, player)
      return player:getMark(wudi.name)==0
    end,
    enabled_at_response = function(self, player, response)
      return false
    end,
  })
  
  wudi:addEffect(fk.CardUseFinished, {
    mute=true,
    can_trigger = function(self, event, target, player, data)
      return player:hasSkill(wudi.name) and player:getMark(wudi.name)~=0 and
      player:getMark(wudi.name)==data.card.name and data.card.skillName~=wudi.name
    end,
    on_cost = function(self, event, target, player, data)
      return true
    end,
    on_use = function(self, event, target, player, data)
      player.room:setPlayerMark(player,wudi.name,0)--设置为0
    end,
  })
  


return wudi